﻿#include "MeConvert.h"

using namespace std;
using namespace cv;

std::vector<Point3d> MeConvert::toCvPoints(std::vector<MePoint3D> &pts)
{
    std::vector<cv::Point3d> p3ds;
    for (uint i=0; i< pts.size(); i++) {
        MePoint3D &p = pts[i];
        p3ds.push_back({p[0], p[1],p[2]});
    }

    return p3ds;
}

std::vector<Point2f> MeConvert::toCvPoints(std::vector<KeyPoint> &kps)
{
    vector<Point2f> points;
    for (uint i = 0; i < kps.size(); i++) {
        points.push_back(kps[i].pt);
    }
    return points;
}

void MeConvert::keyPointsToCvPoints(std::vector<KeyPoint> &kps, std::vector<Point2f> &outPts)
{
    outPts.clear();
    for (uint i = 0; i < kps.size(); i++) {
        outPts.push_back(kps[i].pt);
    }
}
